﻿@{
    Layout = null;
    var CoinGold = ViewData["CoinGold"] as Pay.DTO.task_dto;


}

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>  戈仑埠</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0,maximum-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" href="~/Content/css/base.css" />
    <link rel="stylesheet" href="~/Content/css/tuoken.css" />
    <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script type="text/javascript" src="~/Content/js/base.js"></script>
    <script src="~/Content/js/layer/1.9.3/layer.js"></script>
    <script type="text/javascript">
        var flag = false; 
        function submit() {
            if (flag) return;
            flag = true;
            $("#recive").addClass("on").text("领取中");
            $.ajax({
                //几个参数需要注意一下
                type: "POST",//方法类型
                dataType: "json",//预期服务器返回的数据类型
                url: "/Task/GeLunBuPost",//url
                data: {},
                success: function (result) {
                    if (result.result_code == 1000) {
                        layer.msg("领取成功");
                        window.location.reload();
                    } else {
                        layer.msg(result.result_msg);
                    }
                    flag = false;
                     $("#recive").removeClass("on").text("我已注册并登录（+@CoinGold.soup_value 马力）");
                },
                error: function () {
                    layer.msg("异常！");
                    flag = false;
                      $("#recive").removeClass("on").text("我已注册并登录（+@CoinGold.soup_value 马力）");
                }
            });
        }
    </script>
</head>
<body>
        <div class="aboutwhite">
            <div class="refuelcard">
                <div class="refulcard_explain">
                    <div class="impower">
                        <p>取得戈仑埠授权</p>
                        <p>即可获得3个马力值奖励</p>
                    </div>
                    <ul>
                        <li><em>1</em><div class="msg">下载戈仑埠APP</div></li>
                        <li><em>2</em><div class="msg">用当前手机号注册并登录戈仑埠APP</div></li>
                        <li><em>3</em><div class="msg">完成之后回到拓垦APP内点击“我已注册并登录”按钮，验证成功后获得马力。</div></li>
                    </ul>

                </div>
                <p class="refulcard_explainfo">说明：每一个拓垦账号只能领取一次！</p>
            </div>
            @if (CoinGold.is_complete) {
                <div class="impower_pd">
                    <div class="impower_task">
                        <p class="succeed"> <i></i> 恭喜你已经完成该任务</p>
                    </div>
                    <a href="#" class="impower_btn on" style="height:0.8rem;width:77%; margin:0 auto;line-height: 0.8rem">您已经获得过马力值了</a>
                </div>

            } else {
                <div class="impower_pd">
                    <div class="impower_task">
                        <p> 该任务必须要下载注册登录戈仑埠APP</p>
                        <p>并且是使用同一个手机号才能够完成</p>
                    </div>

                    <a href="javascript:void(0)" onclick="submit()" class="impower_btn" id="recive" style="height:0.8rem;width:77% ;margin:0 auto;line-height: 0.8rem">我已注册并登录（+@CoinGold.soup_value 马力）</a>

                </div>
            }
        </div>
    </body>
</html>